export const onBackPressed = (router) => {
  const params = {
    action: 'back',
    extra: '',
  };
  try {
    window.AndroidJs.h5MessageToAndroid(JSON.stringify(params));
    router.back();
  } catch (error) {
    console.error('安卓返回失败');
  }
};

export const onOpenWebsitePressed = (url) => {
  const params = {
    action: 'open',
    extra: url,
  };
  try {
    window.AndroidJs.h5MessageToAndroid(JSON.stringify(params));
  } catch (error) {
    console.error('安卓返回失败');
  }
};
